import type { TableColumn, FormField } from '@/components'
import { reactive } from 'vue'

export const fields = reactive<FormField[]>([
  {
    key: 'name',
    label: '昵称',
    tag: 'ElInput'
  }
])

export const columns: TableColumn[] = [
  {
    key: 'name',
    label: '名称'
  },
  {
    key: 'created_at',
    label: '创建日期'
  },
  {
    key: 'actions',
    label: '操作',
    slot: true,
    fixed: 'right'
  }
]

export const dialogFields = reactive<FormField[]>([
  {
    key: 'name',
    label: '菜单名称',
    tag: 'ElInput',
    required: true
  },
  {
    key: 'route',
    label: '路由标识',
    tag: 'ElInput',
    required: true
  },
  {
    key: 'icon',
    label: '图标',
    tag: 'ElInput',
    required: true
  },
  {
    key: 'type',
    label: '类型',
    tag: 'MSelect',
    required: true,
    attrs: {
      options: [
        {
          label: '菜单',
          value: '1'
        },
        {
          label: '按钮',
          value: '2'
        }
      ]
    }
  }
])
